<template>
	<view class="w-full h-full">
		<map class="w-full h-full" :latitude="latitude" :longitude="longitude" :markers="markers"></map>
	</view>
</template>

<script>
	export default {
	    data() {
	        return {
				id:0, // 使用 marker点击事件 需要填写id
	            title: 'map',
	            latitude: 30.25419,
	            longitude: 106.891479,
	            markers: []
	        }
	    },
		onLoad() {
			let site = uni.getStorageSync('site');
			if (site && typeof site === 'string' && site.split(',').length == 2) {
				this.latitude = site.split(',')[0];
				this.longitude = site.split(',')[1];
			}
			this.$http('/api/region/recyclersnearby').then(data => {
				this.markers = data.recycler;
			})
		},
	    methods: {
			
	    }
	}
</script>

<style lang="scss" scoped>
	.w-full {
		width: 100%;
	}
	
	.h-full {
		height: 100vh;
	}
</style>
